home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 March / PCWorld_2008-03_cd.bin / v cisle / mediacoder / MediaCoder-0.6.1.4045.exe / extensions / Archos.7z / main.js < prev   
Text File  |  2007-02-26  |  2KB  |  63 lines

  1. /*************************************************************************
  2. * MediaCoder extension - Archos AV Series
  3. * Distributed under GPL license
  4. * Copyright (c) 2005-06 Stanley Huang <stanleyhuangyc@yahoo.com.cn
  5. * All rights reserved.
  6. *************************************************************************/
  7.  
  8. function SetModel(model)
  9. {
  10.     SendCommand("stop_play");
  11.     // switch picture
  12.     if (model == "0") {
  13.         // resize window
  14.         window.innerWidth = 910;
  15.         window.innerHeight = 400;
  16.         devimg.src = "av700.png";
  17.         lcd.style.left = 338;
  18.         lcd.style.top = 84;
  19.     } else {
  20.         devimg.src = "av500.png";
  21.         window.innerWidth = 910;
  22.         window.innerHeight = 460;
  23.         lcd.style.left = 276;
  24.         lcd.style.top = 129;
  25.     }
  26.     ApplyParams();
  27. }
  28.  
  29. function ApplyParams()
  30. {
  31.     var doc = NewXML("MediaCoderPref");
  32.     if (!doc) {
  33.         alert("Error creating config XML");
  34.         return;
  35.     }
  36.     
  37.     var model = document.getElementById("model").value;
  38.     var format = document.getElementById("format").value;
  39.     
  40.     AddPrefNode(doc, "overall.video.format", format);
  41.     AddPrefNode(doc, "overall.video.bitrate", document.getElementById("vb").value);
  42.     AddPrefNode(doc, "audioenc.lame.quality", document.getElementById("aq").value);
  43.     AddPrefNode(doc, "videofilter.frame.fps", document.getElementById("fps").value);
  44.     
  45.     if (model == 0) {
  46.         AddPrefNode(doc, "videofilter.scale.width", 480);
  47.         AddPrefNode(doc, "videofilter.scale.height", 234);
  48.     } else {
  49.         AddPrefNode(doc, "videofilter.scale.width", 480);
  50.         AddPrefNode(doc, "videofilter.scale.height", 272);
  51.     }
  52.     AddPrefNode(doc, "videofilter.crop.mode", document.getElementById("crop").value);
  53.     
  54.     // post settings to MediaCoder
  55.     PostPrefXML(doc);
  56. }
  57.  
  58. function Unload()
  59. {
  60.     // stop playback
  61.     SendCommand("stop_play");
  62. }
  63.